<template>
  <s-layout :bgStyle="{ color: '#090909' }">
    <image class="commodity" src="@/static/img/officerDetail/img-2.png"></image>
    <view class="officerDetail">
      <view class="product">
        <view class="product-t">九玄数字居民 </view>
        <view class="product-b ss-flex ss-col-center">
          <view class="ss-flex">
            <view class="text-1">系列：</view>
            <view class="text-2">数字形象</view>
          </view>
          <view class="ss-flex">
            <view class="text-1">限量/</view>
            <view class="text-2">50000</view>
          </view>
        </view>
      </view>
      <view class="issuer ss-flex">
        <image class="issuer-l" src="@/static/img/officerDetail/img-1.png"></image>
        <view class="issuer-r">
          <view class="text-1">发行方</view>
          <view class="text-2">九丝城宇宙</view>
        </view>
      </view>

      <view class="product-content">
        <view class="tab ss-flex">
          <view @tap="active=0" :class="{'active':active===0}">商品详情</view>
          <view @tap="active=1" :class="{'active':active===1}">权益介绍</view>
        </view>
        <view class="productDetails" v-if="active===0">
          <image mode="widthFix" src="@/static/img/pro-icon-1.png"></image>
        </view>
        <view class="commodityRights" v-if="active===1">
          <view class="title">商品权益</view>
          <view class="introduce">
            <view v-for="item in commodityRightsList" :key="item.id" class="ss-flex">
              <view class="text-1">{{item.title}}</view>
              <view class="ss-flex-1 text-2">{{item.text}}</view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <su-fixed bottom :val="0"  :isInset="false">
      <view class="officialDetail-footer ss-flex ss-col-center ss-row-between">
        <view class="footer-left ss-flex ss-col-bottom">
          <view class="text-price">399800.00</view>
        </view>
        <view class="footer-right">
          <button @tap="state.showCoupon = true">购买</button>
        </view>
      </view>
    </su-fixed>
    <PopupActualPayment
      v-model="state.couponInfo"
      :show="state.showCoupon"
      @confirm="onConfirm"
      @close="state.showCoupon = false"
    />
  </s-layout>
</template>

<script setup>
  import { computed, ref, reactive, getCurrentInstance, onMounted, nextTick,  } from 'vue';
  import sheep from '@/sheep';
  import PopupActualPayment from  './components/popup-actualPayment/index.vue'
  const active = ref(0);
  const commodityRightsList = ref([
    {
      title: '商品名称',
      text: '米其林汽车轮胎',
      id: 0,
    },{
      title: '流转方式',
      text: '品牌孵化',
      id: 1,
    },{
      title: '拆配周期',
      text: '93天/轮*4',
      id: 2,
    },{
      title: '孵化上市',
      text: '2024年4月17日',
      id: 3,
    },{
      title: '孵化上限',
      text: '40份',
      id: 4,
    },{
      title: '预期收益',
      text: '3%',
      id: 5,
    },{
      title: '收益周期',
      text: 'D+8天/次',
      id: 6,
    },{
      title: '孵化退市',
      text: '2025年4月24日',
      id: 7,
    },
  ]);
  const state = reactive({
    orderPayload: {},
    orderInfo: {},
    addressInfo: {},
    invoiceInfo: {},
    totalNumber: 0,
    showCoupon: false,
    couponInfo: [],
    showDiscount: false,
  });
  function onConfirm() {

  }
</script>

<style lang="scss" scoped>
  .officerDetail {
    padding: 15px 15px 110px;
    box-sizing: border-box;
    background-color: #090909;


    .product {
      background: #1C1C1E;
      border-radius: 10px;
      padding: 18px 20px 19px;
      box-sizing: border-box;

      .product-t {
        font-weight: 400;
        font-size: 20px;
        color: #FFFFFF;
        margin-bottom: 14.5px;
      }

      .product-b {
        font-weight: 400;
        font-size: 14px;

        .text-1 {
          color: #939393;
        }

        .text-2 {
          color: #13C093;
        }

        view {

        }
      }
    }

    .issuer {
      background: #1C1C1E;
      border-radius: 10px;
      padding: 14px 15px;
      box-sizing: border-box;
      height: 70px;
      margin: 10px 0;

      .issuer-l {
        width: 43px;
        height: 43px;
        border-radius: 50%;
        margin-right: 9px;
      }

      .issuer-r {
        .text-1 {
          font-weight: 400;
          font-size: 16px;
          color: #FFFFFF;
          margin-bottom: 6px;
        }

        .text-2 {
          font-weight: 400;
          font-size: 10px;
          color: #888888;
        }
      }
    }

    .product-content {
      background: #1C1C1E;
      border-radius: 10px;
      padding: 24px 15px;
      box-sizing: border-box;
      .tab {
        padding: 0 4px;
        box-sizing: border-box;
        font-weight: 400;
        font-size: 18px;
        color: #767676;
        margin-bottom: 25px;

        view {
          margin-right: 20px;
        }
        .active {
          color: #FFFFFF;
        }

      }

      .productDetails {
        image{
          width: 100%;
        }
      }
      .commodityRights {
        .title{
          padding: 13px 12px;
          box-sizing: border-box;
          height: 40px;
          background: #221D1A;
          font-weight: 400;
          font-size: 14px;
          color: #DFB581;
        }
        .introduce{
          >view{
            height: 40px;
            line-height: 40px;
            text-align: center;
            background: #15110E;
            border-bottom: 1px solid #2F2933;
          }
          .text-1{
            width: 96px;
            font-weight: 300;
            font-size: 13px;
            color: #DFB581;
            border-right: 1px solid #2F2933;
          }
          .text-2{
            font-weight: 300;
            font-size: 12px;
            color: #AC8866;
          }
        }
      }

    }
  }

  .commodity {
    width: 100%;
    height: 375px;
  }
  .officialDetail-footer{
    padding: 20px 16px;
    box-sizing: border-box;
    height: 90px;
    background: #151515;
    .footer-left{
      .currency{
        font-weight: 500;
        font-size: 16px;
        color: #FFFFFF;
      }
      .text-price{
        font-weight: 500;
        font-size: 16px;
        color: #FFFFFF;
      }
    }
    .footer-right{
      button{
        width: 120px;
        height: 50px;
        line-height: 50px;
        text-align: center;
        background: linear-gradient(90deg, #45C9F0, #36F6AF);
        border-radius: 25px;
        font-weight: 500;
        font-size: 16px;
        color: #090909;
      }

    }
  }


</style>
